/**
 * 
 */

$(document).ready(function () {
	
	$(".delete").click(function () {
		if (confirm('Are you sure to delete this article?')) {
			var articleId = $(this).attr('data-id');
			$.ajax({
				url: absoluteURL('/articles/delete'),
				data: { "articleId": articleId },
				dataType: 'json',
				success: function (data) {
					if (data.status == 0) {
						alert('Delete article successfully');
						location.reload();
					} else {
						alert('Delete article faild.');
					}
				}
			});
		}
	});
});